<?php use application\Comm\Func;
$pager = new \application\Comm\Pager($page);
?>
<link rel="stylesheet" href="<?php echo Func::staticUrl('css/prdinfo.css?v=201706') ?>">
<style>
	.now_page{background-color: #b5b8bd;}
</style>
<!--头部-->

<!--列表页内容-->
<div class="prd_con wrap">
    <div class="prd_con_list">
        <ul>
            <li>
                <div class="list_tit"><span><i class="item"></i>项目</span></div>
                <div class="list_box">
                    <dl>
                        <dt>
                            <a <?php if ($space =='index') echo 'class="act"'?>  href="<?php echo Func::createUrl('product/index',['space'=>'index']) ?>">全部</a>
                        </dt>
                        <dd>
                         <?php foreach ($category as $k =>$v){?>
		                    <a <?php if ($space == $v['name1']) echo 'class="act"'?> href="<?php echo Func::createUrl('product/index', ['space' => $v['name1']]) ?>">
		                      		 <?php echo $v['name']?>
		                    </a>
	                    <?php }?>

                        </dd>
                    </dl>
                </div>

            </li>
            <li>
                <div class="list_tit"><span><i class="style"></i>风格</span></div>
                <div class="list_box">
                    <dl>
                        <dt>
                            <a <?php if ($style_id == 0) echo 'class="act"' ?>href="<?php echo Func::productUrl(['style_id' => 0, 'p' => 1]) ?>">全部</a>
                        </dt>
                        <dd>
                             <?php foreach ($styles as $k => $v) {
                                    if ($k == $style_id) {
                                        ?>
                                        <a class="act"
                                           href="<?php echo Func::productUrl(['style_id' => $k, 'p' => 1]) ?>">
                                            <?php echo $v ?>
                                        </a>
                                    <?php } else {?>
                                        <a href="<?php echo Func::productUrl(['style_id' => $k, 'p' => 1]) ?>">
                                            <?php echo $v ?>
                                        </a>
                            <?php }} ?>
                        </dd>
                    </dl>
                </div>
            </li>
            <li>
                <div class="list_tit"><span><i class="area"></i>面积</span></div>
                <div class="list_box">
                    <dl>
                        <dt>
                            <a <?php if ($acreage_id == 0) echo 'class="act"' ?>
                                    href="<?php echo Func::productUrl(['acreage_id' => 0, 'p' => 1]) ?>">全部</a>
                        </dt>
                        <dd>
                               <?php foreach ($acreage[$space_id] as $k => $v) {
                                    if ($k == $acreage_id) {
                                        ?>
                                        <a class="act"
                                           href="<?php echo Func::productUrl(['acreage_id' => $k, 'p' => 1]) ?>">
                                            <?php echo $v ?>
                                        </a>
                                    <?php } else {
                                        ?>
                                        <a href="<?php echo Func::productUrl(['acreage_id' => $k, 'p' => 1]) ?>">
                                            <?php echo $v ?>
                                        </a>
                                    <?php }
                                } ?>
                        </dd>
                    </dl>
                </div>
            </li>
            <li>
                <div class="list_tit"><span><i class="functions"></i>功能</span></div>
                <div class="list_box">
                    <dl>
                        <dt>
                            <a <?php if ($function_id == 0) echo 'class="act"' ?>
                                    href="<?php echo Func::productUrl(['function_id' => 0, 'p' => 1]) ?>">全部</a>
                        </dt>
                        <dd>
                            <?php if (isset($functions[$space_id])){?>
                                <?php foreach ($functions[$space_id] as $k => $v) {
                                    if ($k == $function_id) {
                                        ?>
                                        <a class="act"
                                           href="<?php echo Func::productUrl(['function_id' =>$k, 'p' => 1]) ?>">
                                            <?php echo $v ?>
                                        </a>
                                    <?php } else {
                                        ?>
                                        <a href="<?php echo Func::productUrl(['function_id' => $k, 'p' => 1]) ?>">
                                            <?php echo $v ?>
                                        </a>
                                    <?php }}
                                } ?>
                        </dd>
                    </dl>
                </div>
            </li>
            <li>
                <div class="list_tit"><span><i class="price"></i>价格</span></div>
                <div class="list_box">
                    <dl>
                        <dt>
                            <a <?= $price_id == 0 ? 'class="act"' : '';?> href="<?php echo Func::productUrl(['price_id' => 0, 'p' => 1]) ?>">全部</a>
                        </dt>
                        <dd>

                      	<?php if (isset($prices_all[$space_id])){?>
                           <?php foreach ($prices_all[$space_id] as $k=>$v):?>
	                			<a <?= $price_id == $k ? 'class="act"' : '';?> href="<?php echo Func::productUrl(['price_id' => $k, 'p' => 1],['price_min','price_max']) ?>">
	                        	<?= $v['lable'] ?>
	                        	</a>
                			<?php endforeach;}?>
                        </dd>
                    </dl>
                </div>
            </li>
        </ul>
    </div>
    <div class="prd_type">
        <div class="prd_type_list">
          <ul>
         		<?php if ($orderby == 4){ echo  '<li class="act">';}else { echo  '<li>';}?>
                		<a href="<?= Func::productUrl(['orderby' => 4, 'ordertype' => 'desc','p' => 1]) ?>"  class="down"><span>最热</span></a>
                    <i class="icon1"></i>

                </li>

                <?php if ($orderby == 3){ echo  '<li class="act">';}else { echo  '<li>';}?>
                		<a href="<?= Func::productUrl(['orderby' => 3, 'ordertype' => 'desc','p' => 1]) ?>"  class="down"><span>新品</span></a>
                    <i class="icon1"></i>
                </li>

                  <?php if ($orderby == 1){ echo  '<li class="act">';}else { echo  '<li>';}?>
                    <a href="<?= Func::productUrl(['orderby' => 1, 'ordertype' => 'desc','p' => 1]) ?>"  class="up"><span>销量</span></a>
                    <i class="icon1"></i>
                </li>


                 <?php if ($orderby == 5){ echo  '<li class="act">';}else { echo  '<li>';}?>
                    <a href='<?= Func::productUrl(['orderby' => 5, 'ordertype' => 'desc','p' => 1]) ?>'><span>面积</span></a>
                    <span class="icon2">
                    <a href="<?= Func::productUrl(['orderby' => 5, 'ordertype' => 'asc','p' => 1]) ?>"  class="up"></a>
                    <a href="<?= Func::productUrl(['orderby' => 5, 'ordertype' => 'desc','p' => 1]) ?>"  class="down"></a>
                    </span>
                </li>

                <?php if ($orderby == 2){ echo  '<li class="act">';}else { echo  '<li>';}?>
                    <a href='<?= Func::productUrl(['orderby' => 2, 'ordertype' => 'desc','p' => 1]) ?>'><span>价格</span></a>
                    <span class="icon2">
                       <a href="<?= Func::productUrl(['orderby' => 2, 'ordertype' => 'asc','p' => 1]) ?>"  class="up"></a>
                       <a href="<?= Func::productUrl(['orderby' => 2, 'ordertype' => 'desc','p' => 1]) ?>"  class="down"></a>
                    </span>
                </li>
            </ul>

            <div class="price_sel input_focus">
                 <form action="<?php echo Func::createUrl('product/index') ?>" method="get">
                        <label>
                            <input name="price_min" type="text" value="最低价" value="">
                            <i></i>
                        </label>
                        <span style="color: #4c4c4c;">-</span>
                        <label>
                            <input name="price_max"  type="text" value="最高价" value="">
                            <i></i>
                        </label>
                        <input type='submit' class="sel_sub" value='确认'>
                    </form>
            </div>
        </div>
    </div>
    <div class="prd_products mg_t_20">
        <ul>
           <?php if (isset($products) && !empty($products)) { ?>

                    <?php foreach ($products as $k => $v) { ?>
            <li>
                <a href="<?php echo $v['url'] ?>" target='_blank' alt="<?php echo $v['name'] ?>"
                                           title="<?php echo $v['name'] ?>">
                           <img src="<?php echo $v['thumb'] ?>"/>
                 </a>
                <div class="describe">
                    <span>¥ <?php echo $v['price_show']?></span>
                    <p><?php echo $v['description']?></p>
                </div>
            </li>
               <?php } ?>

         <?php } ?>
        </ul>

    </div>
    <div class="paging_list">


          <?php
                    echo $pager->show('2');
          ?>

    </div>
    <div class="recommend">
        <div class="tit">
            <h3>为您推荐</h3>
            <a href='javascript:;' onclick="location.reload()"><span class="change">换一组<i></i></span></a>
        </div>
        <ul>
        <?php if (count($Recommend)>0){?>
        	<?php foreach ($Recommend as $k => $v){?>
	            <li>
	                <a href="<?= $v['url']?>">
	                    <img src="<?= $v['thumb']?>">
	                </a>
	                <div class="bewrite">
	                    <span>¥ <?= $v['price']?></span>
	                    <p><?= $v['name']?></p>
	                </div>
	            </li>
            <?php }?>

         <?php }?>
        </ul>
    </div>
</div>
<!--公共尾部-->


</body>
</html>
